{% extends 'base.html' %}
{% block title %}
    {{ block.super }}-注册
{% endblock %}

{% block head %}
    <script src="{% static 'jquery/jquery-3.7.1.min.js' %}"></script>
    <script src="{% static 'js/register.js' %}"></script>
{% endblock %}

{% block main %}
    <div style="max-width: 300px;" class="m-auto">
        <h1 class="text-center mb-5">注册</h1>
                    {% if form.errors %}
                    	<h3>{{ form.errors }}</h3>
                    {% endif %}
        <form action="" method="POST">
            {% csrf_token %}
            <div class="mb-3 d-flex justify-content-between align-items-center">
                <label for="username" class="form-label">用户名:</label>
                <input type="text" class="form-control " id='username' name="username" placeholder="请输入用户名"
                       style="width: 230px;">
            </div>
            <div class="mb-3 d-flex justify-content-between align-items-center">
                <label for="email" class="form-label">邮箱:</label>
                <input type="email" class="form-control " id='email' name="email" placeholder="请输入邮箱"
                       style="width: 230px;">
            </div>

            <div class="mb-3 d-flex justify-content-between align-items-center">
                <label for="captcha" class="form-label">验证码:</label>
                <div class="input-group mb-3" style="width: 230px;">
                    <input type="text" class="form-control" placeholder="验证码" id="captcha" name="captcha"
                           aria-label="Recipient's username" aria-describedby="button-addon2">
                    <button class="btn btn-outline-secondary" type="button" id="captcha-btn">获取验证码</button>
                </div>
            </div>
            <div class="mb-2 d-flex justify-content-between align-items-center">
                <label for="password" class="form-label">密码:</label>
                <input type="password" class="form-control" id='password' name="password" placeholder="请输入密码"
                       style="width: 230px;">
            </div>
            <div class="mt-2">
                <button class="btn btn-primary w-100">注册</button>
            </div>
        </form>
    </div>
{% endblock %}